package starblaze 
{
  import flash.utils.ByteArray;
	
  public class Component 
  {
    
    public function needAttributes(verifier:AttributeVerifer):void { }
    
    public function registerConstants(registrar:ConstantRegistrar):void { }
    public function registerVariables(registrar:VariableRegistrar):void { }
    
    public function buildBytecode(builder:BytecodeBuilder, 
                                  cl:ConstantLookup, 
                                  vl:VariableLookup, 
                                  oal:OutputAttributeLookup, 
                                  ial:InternalAttributeLookup):void
    { }
    
    internal var m_constantRegistrar:ConstantRegistrar = null;
    internal final function updateConstants(constantStream:ByteArray, lookup:ConstantLookup):void
    {
      for each (var constant:Constant in m_constantRegistrar)
      {
        constantStream.position = lookup.getIndex(constant);
        if (constant.type.equals(Type.INT))
          constantStream.writeInt(int(constant.value));
        else if (constant.type.equals(Type.FLOAT))
          constantStream.writeFloat(Number(constant.value));
      }
    }
  }

}
